home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Latest Shareware Programs: Warp / OS-2 WARP - Latest Shareware Programs.iso / zipped.os2 / treiber.1 / elsa312.exe / INSTE.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-23  |  7KB  |  287 lines

  1. /*
  2. @echo off
  3. cls
  4. echo.
  5. echo.
  6. echo ERROR:
  7. echo REXX support not installed
  8. echo You must have REXX support installed to run this
  9. echo program.
  10. echo.
  11. echo To run this program, run Selective Install from
  12. echo your System Setup folder, and install REXX or
  13. echo run install2.cmd .
  14. exit
  15. */
  16.  
  17. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  18. call SysLoadFuncs
  19. /*-- get the command line --*/
  20. parse arg sourcedir destdir
  21.  
  22.  
  23. call SysCls
  24. readmefile = 'readme'
  25. readmename = 'Read me'
  26. bDeu = "2 "
  27. fWinMan = 0
  28.  
  29.  
  30.   /* Go search for the OS2.INI file, this will be our bootdrive */
  31.   testos2path = SysSearchPath('PATH', 'OS2.INI');
  32.   bootdrive = FILESPEC("drive", testos2path);
  33.   os2path = FILESPEC("path",testos2path);
  34.   ver = SysOS2Ver()
  35.  
  36. /*-- get dest dir --*/
  37. if destdir = '' then do
  38.   say ''
  39.   say 'Please enter a directory name for ELSA Video Driver'
  40.   say '(Default: 'bootdrive'\WINOS232):'
  41.   /*-- if error --*/
  42.   parse pull destdir
  43.   if destdir = ' ' then do
  44.     destdir = bootdrive'\WINOS232'
  45.   end
  46. end
  47.  
  48.  
  49.   DestDrive = FILESPEC("drive", destdir)
  50. if sourcedir = '' then do
  51.   thisdir = directory()
  52.   say ''
  53.   say 'Please enter the directory where the program is being installed'
  54.   say 'from(Default: 'thisdir'):'
  55.   parse pull sourcedir
  56.   /*-- if another error --*/
  57.   if sourcedir = ' ' then do
  58.     sourcedir = thisdir
  59.     say 'using the current directory as the source directory.'
  60. end
  61.  
  62. /*-- make sure path is good --*/
  63. If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
  64.     sourcedir = sourcedir||'\'
  65.  
  66. /*-- do main screen --*/
  67. call SysCls
  68. say
  69. say '                   ELSA Video Driver Installation'
  70. say
  71. say 'The ELSA Video Driver will be Installed with the following settings:'
  72. say
  73. say 'Source directory: "'sourcedir'"'
  74. say 'Destination directory: "'destdir'"'
  75. say
  76. say 'Okay to continue(Y/n)?'
  77. k = SysGetKey('NOECHO')
  78. if k = 'N' | k = 'n' then do
  79.   say
  80.   say 'Installation cancelled.'
  81.   exit
  82. end
  83.  
  84.  
  85.      ScreenSys = SysSearchPath('PATH', 'screen01.sys');
  86.      "@attrib -r -h -s "||ScreenSys
  87.      if ScreenSys > ' ' then
  88.         "@copy "||ScreenSys||" "||bootdrive||os2path||"*.ibm"
  89.      call CopyDriverFiles sourcedir , destdir
  90.      DestDrive
  91.      "@CD "||destdir
  92.      DosSys = SysSearchPath('PATH', 'doskrnl');
  93.      DosPath = FILESPEC("PATH", DosSys);
  94.  
  95.      VsvgaSys = bootdrive||DosPath||"vsvga.*"
  96.      call SysFileTree VsvgaSys , 'file' , 'F'
  97.      if file.0 > 0 then do
  98.         "@attrib -r -h -s "||bootdrive||DosPath||"vsvga.sys"
  99.      end  
  100.      "@attrib -r -h -s "||bootdrive||os2path||"dll\*.dll"
  101.      if DosSys > " " then
  102.         "@copy "||destdir||"\vsvga.sys "||bootdrive||DosPath||"*.*"
  103.      if (COMPARE(ver,'2.1') < 4) then do
  104.         "@copy "||destdir||"\elsainst.dll "||bootdrive||os2path||"dll"
  105.         "@copy "||bootdrive||os2path||"install\dspinstl.exe"||" "||destdir
  106.      end
  107.  
  108.      call SaveWinIni DestDrive destdir
  109.  
  110.      DSPINSTL.EXE                       /* go execute DSPINSTL */
  111.      say ""
  112. /*-- create a program object --*/
  113. call SysCls
  114. say
  115. say
  116. say
  117. say
  118. say 'ELSA Resolution Manager can be installed as an object on your desktop.'
  119. say 'Do you want to create it now(Y/n)?'
  120. k = SysGetKey('NOECHO')
  121. if k = 'N' | k = 'n' then call WinMan
  122.  
  123. say
  124. say 'Creating the program folder,'
  125. x = SysCreateObject("WPFolder",,
  126.                     "ELSA Video Configuration",,
  127.                     "<WP_DESKTOP>",,
  128.                     "OBJECTID=<ELSAFLDR>;ICONFILE="||destdir||"\wininst.ICO", "replace")
  129. if x = 0 then do
  130.   say 'Unable to create folder; cancelling.'
  131.   exit
  132. end
  133.  
  134.  
  135. say readmefile||' file,'
  136. x = SysCreateObject("WPProgram",,
  137.                     readmename,,
  138.                     "<ELSAFLDR>",,
  139.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\"||readmefile)
  140.  
  141. say 'and the Program file.'
  142. x = SysCreateObject("WPProgram",,
  143.                     "ELSA Resolution Manager",,
  144.                     "<ELSAFLDR>",,
  145.                     "EXENAME="||destdir||"\WININST.EXE;STARTUPDIR="||destdir)
  146.  
  147.  
  148. WinMan:
  149.  
  150.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  151.   winpath = result
  152.   windrive = FILESPEC("drive", result);
  153.   if result = "ERROR:"  then
  154.      do
  155.      winpath = os2path||'mdos\winos2'
  156.      windrive = bootdrive
  157.      end
  158.  
  159. winlen = length(winpath)
  160. if substr( winpath, winlen, 1 ) \= '' then do
  161.    winlen = length(winpath) - 1
  162. end
  163.  
  164.  
  165. WinManMsg:
  166. say
  167. say
  168. say
  169. say
  170. say 'Please insert the WINGUI diskette in drive a:'
  171. say 'Continue ? (Y/N)'
  172. k = SysGetKey('NOECHO')
  173. if k = 'N' | k = 'n' then call GoodBye
  174.  
  175. call SysFileTree 'a:\winma*.*', 'file' , 'F'
  176.  
  177. if file.0 = 0 then do
  178.    BEEP(250,250)
  179.    BEEP(250,250)
  180.    call WinManMsg
  181. end
  182.  
  183. param = bDeu||winpath
  184. "@call wmancopy.bat "||param
  185.  
  186.  
  187. say 'Please wait, while coping and expanding the windows driver...'
  188. say
  189.  
  190. fWinMan = 1
  191.  
  192. call GoodBye
  193.  
  194.  
  195.  
  196.  
  197. GoodBye:
  198. /*-- exit with a goodbye --*/
  199.      call RestoreWinIni fWinMan DestDrive destdir
  200. call SysCls
  201. say
  202. say
  203. say
  204.      if fWinMan = 0 then do
  205.         say 'ELSA Windows Resolution Manager (WINMan) was not installed.'
  206.      end
  207.  
  208. say
  209. say 'ELSA Video Adapter File  was installed successfully.'
  210. say 'Please reboot your system.'
  211. say
  212. say 'ELSA Video Configuration Editor has been installed on your system.'
  213. say
  214. say 'Be sure to read the file README for up-to-date information.'
  215. say
  216. exit
  217.  
  218.  
  219. INST_EXIT:
  220.   EXIT
  221.  
  222.  
  223.  
  224. CopyDriverFiles: Arg SrcDrive , DestDir
  225.  
  226.   DestDrive = FILESPEC("drive",DestDir)
  227.   /*-- create the dest. dir --*/
  228.   DestDrive
  229.   rc = SysMkDir(DestDir)
  230.   if rc = 0 then do
  231.     say 'The directory ' DestDir ' was created successfully.'
  232.   end
  233.   else do
  234.     if SysFileTree(DestDir,file,D)>0 then
  235.     do
  236.        say 'The directory ' DestDir ' could not be created successfully; cancelling.'
  237.        exit
  238.     end
  239.   end
  240.   say 'Please wait ....'
  241.   "@xcopy "||SrcDrive||"*.* "||DestDir
  242.   return
  243.  
  244. SaveWinIni: arg backdr backcd
  245.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  246.   winpath = result
  247.   windrive = FILESPEC("drive", result);
  248.   if result = "ERROR:"  then
  249.      do
  250.      winpath = os2path||'mdos\winos2'
  251.      windrive = bootdrive
  252.      end
  253.  
  254.   windrive
  255.   "@cd "||winpath
  256.   "@copy win.ini win.tmp"
  257.  
  258.   backdr
  259.   "@cd "||backcd
  260.  
  261.  
  262.   return
  263.  
  264.  
  265. RestoreWinIni: arg fRestore backdr backcd
  266.   call SysIni 'USER' , 'PM_INSTALL', 'WINOS2_LOCATION'
  267.   winpath = result
  268.   windrive = FILESPEC("drive", result);
  269.   if result = "ERROR:"  then
  270.      do
  271.      winpath = os2path||'mdos\winos2'
  272.      windrive = bootdrive
  273.      end
  274.  
  275.   windrive
  276.   "@cd "||winpath
  277.   if fRestore = 0 then do
  278.      "@copy win.tmp win.ini"
  279.   end
  280.   "@del win.tmp"
  281.  
  282.   backdr
  283.   "@cd "||backcd
  284.  
  285.   return
  286.  
  287.